﻿<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>奇门遁甲排盘软件</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="angular.min.js"></script>
<script language="VBScript">
public times1,times2,times3,times4,times5,times6,times7,times8 dim nshu,
yshu,rshu,sshu dim rw(2) rw(1) = CDate("1/1/2007" + " " + "00:00") rw(2) = CDate("1/1/1925" + " " + "00:00") nshu = DateDiff("yyyy", rw(2), now) yshu = DateDiff("m", rw(1), now) sshu = DateDiff("h", rw(1), now) rshu = DateDiff("d", rw(1), now) times1 = nshu times2 = times1 times7 = rshu times8 = times7 times3 = int(yshu) mod 12
if times3 = 0 then times3 = 12 times4 = times3 times5 = int(sshu) mod 24
if time5 = 0 then times5 = 24 times6 = times5
function tt1(t)
dim yq
yq=t+1925
dim theForm
Set theForm=document.forms("form1")
theForm.years.value=(cstr(yq))
End function

function tt2(t) dim yq yq = t dim theForm Set theForm = document.forms("form1") theForm.months.value = (cstr(yq)) End
function 
function tt4(t)
dim yq
yq=t
dim theForm
Set theForm=document.forms("form1")
theForm.days.value=(cstr(yq))
End function

function tt3(t) dim yq yq = t dim theForm Set theForm = document.forms("form1") theForm.hours.value = (cstr(yq)) End
function '年====================================
function ndd(d)
if d=1 then
times1=times1+1
end if
d=times1
if times1>=98 then times1=times2:d=times2
tt1(d)
End function
function nww(d)
if d=1 then
times1=times1-1
end if
d=times1
if times1<0 then times1=times2:d=times2
tt1(d)
End function
'月 === =================================
function ydd(d) if d = 1 then times3 = times3 + 1 end
if d = times3
if times3 >= 13 then d = 1 : times3 = time4

tt2(d) End
function
function yww(d) if d = 1 then times3 = times3 - 1 end
if d = times3
if times3 <= 0 then d = 12 : times3 = times4 tt2(d) End
function '日====================================
function rdd(d)
if d=1 then
times7=times7+1
end if
d=times7
if times7>=32 then d=1:times7=1
tt4(d)
End function
function rww(d)
if d=1 then
times7=times7-1
end if
d=times7
if times7<=0 then d=31:times7=31
tt4(d)
End function
'时 === =================================
function sdd(d) if d = 1 then times5 = times5 + 2 end
if d = times5
if times5 >= 24 then d = 0 : times5 = 0 tt3(d) End
function

function sww(d) if d = 1 then times5 = times5 - 2 end
if d = times5
if times5 <= 0 then d = 0 : times5 = 0 tt3(d) End
function
</script>
<style>
.container {
	height: 550px;
	width: 960px;
}

.container .tableBox {
	height: 100%;
	width: 350px;
	background: pink;
}

.container .tableBox .trBox {
	background: #f9b86e;
	height: 100px;
}

.container .tableBox .trBox .tdBox {
	width: 80px;
	padding-left: 20px;
}
</style>

</head>

<body ng-app="qimen" ng-controller="qimenController">
	<div class="container">
		<div class="tableBox">
			<!--剪切代码-->
			<form id="form">
				<table border="0" align="center">
					<tbody>
						<tr>
							<td align="center">年： <select id="year" style="width: 55px"
								name="year" size="1">
									<script language="Javascript">
										var j, k;
										j = new Date();
										k = j.getFullYear();
										for (i = 1925; i < 2023; i++) {
											document.write("<option value="
													+ i
													+ (i == k ? " selected>"
															: ">") + i
													+ "</option>")
										}
									</script>
							</select> 月： <select id="month" style="width: 40px" name="month">
									<script language="Javascript">
										var j, k;
										j = new Date();
										k = j.getMonth() + 1;
										for (i = 1; i <= 12; i++) {
											document.write("<option value="
													+ i
													+ (i == k ? " selected>"
															: ">") + i
													+ "</option>")
										}
									</script>
							</select> 日： <select id="days" style="width: 40px" name="day">
									<script language="Javascript">
										var j, k;
										j = new Date();
										k = j.getDate();
										for (i = 1; i <= 31; i++) {
											document.write("<option value="
													+ i
													+ (i == k ? " selected>"
															: ">") + i
													+ "</option>")
										}
									</script>
							</select> 时： <select id="hours" style="width: 40px" name="hours">
									<script language="Javascript">
										var j, k;
										j = new Date();
										k = j.getHours();
										for (i = 0; i <= 23; i++) {
											document.write("<option value="
													+ i
													+ (i == k ? " selected>"
															: ">") + i
													+ "</option>")
										}
									</script>
							</select>
						</tr>
					</tbody>
				</table>
			</form>
			<button ng-click="myData()" style="margin-left: 100px">日期排盘</button>
			<!--剪切代码-->
			<p></p>
			<div id="sizhu"></div>
			<div id="jieqi"></div>
			<div id="zhifu">时旬：甲子戊 值符：天柱 值使：惊门</div>
			<div id="kongwang">时空：戌亥空亡</div>
			<table class="table">
				<tbody>
					<tr class="trBox">
						<td data="4" class="tdBox">
							<table>
								<tbody>
									<tr>
										<td>{{allDate.shen.4}}</td>
									</tr>
									<tr>
										<td>{{allDate.xing.4}} {{allDate.tianpangan.4}}</td>
									</tr>
									<tr>
										<td>{{allDate.men.4}} {{allDate.dipangan.4}}</td>
									</tr>
								</tbody>
							</table>
						</td>
						<td data="9" class="tdBox">
							<table>
								<tbody>
									<tr>
										<td>{{allDate.shen.9}}</td>
									</tr>
									<tr>
										<td>{{allDate.xing.9}} {{allDate.tianpangan.9}}</td>
									</tr>
									<tr>
										<td>{{allDate.men.9}} {{allDate.dipangan.9}}</td>
									</tr>
								</tbody>
							</table>
						</td>
						<td data="2" class="tdBox">
							<table>
								<tbody>
									<tr>
										<td>{{allDate.shen.2}}</td>
									</tr>
									<tr>
										<td>{{allDate.xing.2}} {{allDate.tianpangan.2}}</td>
									</tr>
									<tr>
										<td>{{allDate.men.2}} {{allDate.dipangan.2}}</td>
									</tr>
								</tbody>
							</table>
						</td>
					</tr>
					<tr class="trBox">
						<td data="3" class="tdBox">
							<table>
								<tbody>
									<tr>
										<td>{{allDate.shen.3}}</td>
									</tr>
									<tr>
										<td>{{allDate.xing.3}} {{allDate.tianpangan.3}}</td>
									</tr>
									<tr>
										<td>{{allDate.men.3}} {{allDate.dipangan.3}}</td>
									</tr>
								</tbody>
							</table>
						</td>
						<td data="5" class="tdBox">
							<table>
								<tbody>
									<tr>
										<td>{{allDate.dipangan.5}}</td>
									</tr>
								</tbody>
							</table>
						</td>
						<td data="7" class="tdBox">
							<table>
								<tbody>
									<tr>
										<td>{{allDate.shen.7}}</td>
									</tr>
									<tr>
										<td>{{allDate.xing.7}} {{allDate.tianpangan.7}}</td>
									</tr>
									<tr>
										<td>{{allDate.men.7}} {{allDate.dipangan.7}}</td>
									</tr>
								</tbody>
							</table>
						</td>
					</tr>
					<tr class="trBox">
						<td data="8" class="tdBox">
							<table>
								<tbody>
									<tr>
										<td>{{allDate.shen.8}}</td>
									</tr>
									<tr>
										<td>{{allDate.xing.8}} {{allDate.tianpangan.8}}</td>
									</tr>
									<tr>
										<td>{{allDate.men.8}} {{allDate.dipangan.8}}</td>
									</tr>
								</tbody>
							</table>
						</td>
						<td data="1" class="tdBox">
							<table>
								<tbody>
									<tr>
										<td>{{allDate.shen.1}}</td>
									</tr>
									<tr>
										<td>{{allDate.xing.1}} {{allDate.tianpangan.1}}</td>
									</tr>
									<tr>
										<td>{{allDate.men.1}} {{allDate.dipangan.1}}</td>
									</tr>
								</tbody>
							</table>
						</td>
						<td data="6" class="tdBox">
							<table>
								<tbody>
									<tr>
										<td>{{allDate.shen.6}}</td>
									</tr>
									<tr>
										<td>{{allDate.xing.6}} {{allDate.tianpangan.6}}</td>
									</tr>
									<tr>
										<td>{{allDate.men.6}} {{allDate.dipangan.6}}</td>
									</tr>
								</tbody>
							</table>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
	<div id="formData"></div>
	<script src="js/jquery.min.js"></script>
	<script type="text/javascript">
		var app = angular.module('qimen', []);
		app.controller("qimenController", [
				'$scope',
				'$http',
				function($scope, $http) {
					
					$scope.myData = function(){
						var params = $("#form").serializeArray();
						var values = {};
						for (x in params) {
							values[params[x].name] = params[x].value;
						}
						var year = values.year;
						var month = values.month;
						var day = values.day;
						var hours = values.hours;
						$http({
			                method: "post",
			                params:{"year":year,"month":month,"day":day,"hours":hours},
			                url:"http://127.0.0.1:8081/qimenDate"
			            }).success(
								function(data) {
									$scope.allDate = data;
									$("#sizhu").html(
											"四柱 ：" + data.sizhu.year + "&nbsp;"
													+ data.sizhu.month + "&nbsp;"
													+ data.sizhu.day + "&nbsp;"
													+ data.sizhu.hours + "&nbsp;");
									$("#jieqi").html(
											"节气 ：" + data.jieqi.jieqiName
													+ "&nbsp;&nbsp;元数"
													+ data.jieqi.shangZhongXia
													+ "&nbsp;&nbsp;"
													+ data.jieqi.yinYang
													+ data.jieqi.juNumber + "局");
									$("#zhifu").html(
											"旬首 ：" + data.xunshou
													+ "&nbsp;&nbsp;值符:"
													+ data.zhifuxing
													+ "&nbsp;&nbsp;值使:"
													+ data.zhishimen);
									$("#kongwang").html(
											"时干空亡 ：" + data.kongwang + "  日干空亡 ："
													+ data.rigankongwang);

								})
						
					}
					
					$http.post('http://127.0.0.1:8081/qimenDate').success(
							function(data) {
								$scope.allDate = data;
								$("#sizhu").html(
										"四柱 ：" + data.sizhu.year + "&nbsp;"
												+ data.sizhu.month + "&nbsp;"
												+ data.sizhu.day + "&nbsp;"
												+ data.sizhu.hours + "&nbsp;");
								$("#jieqi").html(
										"节气 ：" + data.jieqi.jieqiName
												+ "&nbsp;&nbsp;元数"
												+ data.jieqi.shangZhongXia
												+ "&nbsp;&nbsp;"
												+ data.jieqi.yinYang
												+ data.jieqi.juNumber + "局");
								$("#zhifu").html(
										"旬首 ：" + data.xunshou
												+ "&nbsp;&nbsp;值符:"
												+ data.zhifuxing
												+ "&nbsp;&nbsp;值使:"
												+ data.zhishimen);
								$("#kongwang").html(
										"时干空亡 ：" + data.kongwang + "  日干空亡 ："
												+ data.rigankongwang);

							})

				} ]);
	</script>
</body>
</html>
